// eslint-disable-next-line
import { UserLayout, BasicLayout, SecondLayout, RouteView, BlankLayout, PageView } from '@/layouts'

export const asyncRouterMap = [
  {
    path: '/',
    component: BasicLayout,
    meta: { title: '首页' },
    redirect: '/projectStandingBook',
    children: [
      // 项目台账
      {
        path: '/projectStandingBook',
        name: 'projectStandingBook',
        meta: { title: '项目台账' },
        hidden: true,
        component: () => import('@/views/projectStandingBook/index')
      },
      // 项目台账内页
      {
        path: '/toProjectStandingBook',
        name: 'toProjectStandingBook',
        component: SecondLayout,
        meta: { title: '项目台账', code: 'projectStandingBook' },
        redirect: '/toProjectStandingBook/summaryStandingBookList',
        children: [
          {
            path: '/toProjectStandingBook/summaryStandingBookList',
            name: 'summaryStandingBookList',
            meta: { title: '台账汇总' },
            component: () => import('@/views/projectStandingBook/components/summaryStandingBookList')
          },
          {
            path: '/toProjectStandingBook/ledgerList',
            name: 'ledgerList',
            meta: { title: '台账清单' },
            component: () => import('@/views/projectStandingBook/components/ledgerList')
          },
          {
            path: '/toProjectStandingBook/equipmentDetails',
            name: 'equipmentDetails',
            meta: { title: '设备详情' },
            hidden: true,
            component: () => import('@/views/projectStandingBook/components/equipmentDetails')
          }
        ]
      },
      // 工程管理
      {
        path: '/projectManagement',
        name: 'projectManagement',
        meta: { title: '工程管理' },
        hidden: true,
        component: () => import('@/views/projectManagement/index')
      },
      // 工程管理内页
      {
        path: '/toProjectManagement',
        name: 'toProjectManagement',
        component: SecondLayout,
        meta: { title: '工程管理', code: 'toProjectManagement' },
        redirect: '/toProjectManagement/projectList',
        children: [
          {
            path: '/toProjectManagement/projectList',
            name: 'projectList',
            meta: { title: '项目列表' },
            component: () => import('@/views/projectManagement/components/projectList')
          },
          {
            path: '/toProjectManagement/addProjects',
            name: 'addProjects',
            hidden: true,
            meta: { title: '添加项目' },
            component: () => import('@/views/projectManagement/components/addProjects')
          },
          {
            path: '/toProjectManagement/proDetails',
            name: 'proDetails',
            hidden: true,
            meta: { title: '项目详情' },
            component: () => import('@/views/projectManagement/components/proDetails')
          },
          {
            path: '/toProjectManagement/projectUpdate',
            name: 'projectUpdate',
            meta: { title: '项目变更申请' },
            component: () => import('@/views/projectManagement/components/projectUpdate')
          },
          {
            path: '/toProjectManagement/projectApproveList',
            name: 'projectApproveList',
            meta: { title: '项目变更审批' },
            component: () => import('@/views/projectManagement/components/projectApproveList')
          },
          {
            path: '/toProjectManagement/projectEndList',
            name: 'projectEndList',
            meta: { title: '项目结项' },
            component: () => import('@/views/projectManagement/components/projectEndList')
          }
        ]
      },
      // 供应商管理
      {
        path: '/supplierManagement',
        name: 'supplierManagement',
        meta: { title: '供应商管理' },
        hidden: true,
        component: () => import('@/views/supplierManagement/index')
      },
      // 供应商管理内页
      {
        path: '/toSupplierManagement',
        name: 'toSupplierManagement',
        component: SecondLayout,
        meta: { title: '供应商管理', code: 'toSupplierManagement' },
        redirect: '/toSupplierManagement/supplierManagementList',
        children: [
          {
            path: '/toSupplierManagement/supplierManagementList',
            name: 'List',
            meta: { title: '供应商列表' },
            component: () => import('@/views/supplierManagement/components/supplierManagementList')
          },
          {
            path: '/toSupplierManagement/equipmentServiceList',
            name: 'equipmentServiceList',
            meta: { title: '设备服务管理' },
            component: () => import('@/views/supplierManagement/components/equipmentServiceList')
          },
          {
            path: '/toSupplierManagement/addSupplier',
            name: 'addSupplier',
            hidden: true,
            meta: { title: '添加供应商' },
            component: () => import('@/views/supplierManagement/components/addSupplier')
          },
          {
            path: '/toSupplierManagement/addEquipmentDetails',
            name: 'addEquipmentDetails',
            hidden: true,
            meta: { title: '添加设备明细' },
            component: () => import('@/views/supplierManagement/components/addEquipmentDetails')
          },
          {
            path: '/toSupplierManagement/addEquipment',
            name: 'addEquipment',
            hidden: true,
            meta: { title: '添加设备' },
            component: () => import('@/views/supplierManagement/components/addEquipment')
          }
        ]
      },
      // 用户管理
      {
        path: '/userManagement',
        name: 'userManagement',
        meta: { title: '用户管理' },
        hidden: true,
        component: () => import('@/views/userManagement/index')
      },
      // 用户管理内页
      {
        path: '/toUserManagement',
        name: 'toUserManagement',
        component: SecondLayout,
        meta: { title: '用户管理', code: 'toUserManagement' },
        redirect: '/toUserManagement/userManagementList',
        children: [
          {
            path: '/toUserManagement/userManagementList',
            name: 'userManagementList',
            meta: { title: '用户管理列表' },
            component: () => import('@/views/userManagement/components/userManagementList')
          },
          {
            path: '/toUserManagement/userEquipmentList',
            name: 'userEquipmentList',
            meta: { title: '用户设备管理' },
            component: () => import('@/views/userManagement/components/userEquipmentList')
          },
          {
            path: '/toUserManagement/userInstallList',
            name: 'userInstallList',
            meta: { title: '用户安装分配' },
            component: () => import('@/views/userManagement/components/userInstallList')
          },
          {
            path: '/toUserManagement/addUsers',
            name: 'addUsers',
            hidden: true,
            meta: { title: '添加用户' },
            component: () => import('@/views/userManagement/components/addUsers')
          }
        ]
      },
      // 运行管理
      {
        path: '/runningManagement',
        name: 'runningManagement',
        meta: { title: '运行管理' },
        hidden: true,
        component: () => import('@/views/runningManagement/index')
      },
      // 运行管理内页
      {
        path: '/toRunningManagement',
        name: 'toRunningManagement',
        component: SecondLayout,
        meta: { title: '运行管理', code: 'runningManagement' },
        redirect: '/toRunningManagement/equipmentOperationMonitoring',
        children: [
          {
            path: '/toRunningManagement/equipmentOperationMonitoring',
            name: 'equipmentOperationMonitoring',
            meta: { title: '设备运行监控' },
            component: () => import('@/views/runningManagement/components/equipmentOperationMonitoring')
          },
          {
            path: '/toRunningManagement/equipmentOperationDetail',
            name: 'equipmentOperationDetail',
            meta: { title: '设备运行监控详情' },
            hidden: true,
            component: () => import('@/views/runningManagement/components/equipmentOperationDetail')
          },
          {
            path: '/toRunningManagement/warnThresholdSetting',
            name: 'warnThresholdSetting',
            meta: { title: '警戒阀值设置' },
            component: () => import('@/views/runningManagement/components/warnThresholdSetting')
          },
          {
            path: '/toRunningManagement/addThreshold',
            name: 'addThreshold',
            meta: { title: '新增阀值' },
            hidden: true,
            component: () => import('@/views/runningManagement/components/addThreshold')
          },
          {
            path: '/toRunningManagement/alarmUserQuery ',
            name: 'alarmUserQuery',
            meta: { title: '报警用户查询' },
            component: () => import('@/views/runningManagement/components/alarmUserQuery')
          },
          {
            path: '/toRunningManagement/alarmDetails ',
            name: 'alarmDetails',
            meta: { title: '用户报警详情' },
            hidden: true,
            component: () => import('@/views/runningManagement/components/alarmDetails')
          },
          {
            path: '/toRunningManagement/repairOrderManagement',
            name: 'repairOrderManagement',
            meta: { title: '维修工单管理' },
            component: () => import('@/views/runningManagement/components/repairOrderManagement')
          },
          {
            path: '/toRunningManagement/orderDetails ',
            name: 'orderDetails',
            meta: { title: '新增工单' },
            hidden: true,
            component: () => import('@/views/runningManagement/components/orderDetails')
          }
        ]
      },
      // 成效管理
      {
        path: '/effectManagement',
        name: 'effectManagement',
        meta: { title: '成效管理' },
        hidden: true,
        component: () => import('@/views/effectManagement/index')
      },
      // 客服管理
      {
        path: '/serviceManagement',
        name: 'serviceManagement',
        meta: { title: '客服管理' },
        hidden: true,
        component: () => import('@/views/serviceManagement/index')
      },
      // 客服管理内页
      {
        path: '/toServiceManagement',
        name: 'toServiceManagement',
        component: SecondLayout,
        meta: { title: '客服管理', code: 'serviceManagement' },
        redirect: '/toServiceManagement/orderList',
        children: [
          {
            path: '/toServiceManagement/orderList',
            name: 'orderList',
            meta: { title: '工单管理' },
            component: () => import('@/views/serviceManagement/components/orderList')
          },
          {
            path: '/toServiceManagement/addOrder',
            name: 'addOrder',
            meta: { title: '新增工单' },
            hidden: true,
            component: () => import('@/views/serviceManagement/components/addOrder')
          },
          {
            path: '/toServiceManagement/messageCenter',
            name: 'messageCenter',
            meta: { title: '消息管理中心' },
            component: () => import('@/views/serviceManagement/components/messageCenter')
          },
          {
            path: '/toServiceManagement/servicemanManage',
            name: 'servicemanManage',
            meta: { title: '维修人员管理' },
            component: () => import('@/views/serviceManagement/components/servicemanManage')
          },
          {
            path: '/toServiceManagement/addPersonnel',
            name: 'addPersonnel',
            meta: { title: '新增人员' },
            hidden: true,
            component: () => import('@/views/serviceManagement/components/addPersonnel')
          },
          {
            path: '/toServiceManagement/personnelHistory',
            name: 'personnelHistory',
            meta: { title: '维修人员历史信息详情' },
            hidden: true,
            component: () => import('@/views/serviceManagement/components/personnelHistory')
          },
          {
            path: '/toServiceManagement/qualityEvaluation',
            name: 'qualityEvaluation',
            meta: { title: '质量评价' },
            component: () => import('@/views/serviceManagement/components/qualityEvaluation')
          }
        ]
      }
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/user',
    component: UserLayout,
    redirect: '/user/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
      },
      {
        path: 'register',
        name: 'register',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
      },
      {
        path: 'register-result',
        name: 'registerResult',
        component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
      },
      {
        path: 'recover',
        name: 'recover',
        component: undefined
      }
    ]
  },

  {
    path: '/test',
    component: BlankLayout,
    redirect: '/test/home',
    children: [
      {
        path: 'home',
        name: 'TestHome',
        component: () => import('@/views/Home')
      }
    ]
  },

  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
